import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from '../views/LoginView'
import HelloView from "@/views/HelloView";
import HelloView2 from "@/views/HelloView2";
import HelloView3 from "@/views/HelloView3";
import MainView from "@/views/MainView";
import UploadView from "@/views/UploadView";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'upload',
    component: UploadView
  },
  {
    path: '/main',
    name: 'main',
    component: MainView
  },
  {
    path: '/hello', //跳转的地址
    name: 'hello',  //路由名称
    component: HelloView, //路由组件
    children:[     //子路由
      {
        path: '/hello1', //跳转的地址
        name: 'hello1',  //路由名称
        component: HelloView2 //路由组件
      },
      {
        path: '/hello2', //跳转的地址
        name: 'hello2',  //路由名称
        component: HelloView3 //路由组件
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
